package com.xr.miniprogram.controller.index;

import com.xr.common.config.XRConfig;
import com.xr.common.core.controller.BaseController;
import com.xr.common.core.domain.AjaxResult;
import com.xr.common.utils.file.FileUploadUtils;
import com.xr.common.utils.file.FileUtils;
import com.xr.framework.config.ServerConfig;
import com.xr.miniprogram.domain.MiniProgramService;
import com.xr.miniprogram.domain.MiniProgramServiceLog;
import com.xr.miniprogram.domain.vo.MiniProgramServiceVO;
import com.xr.miniprogram.service.IMiniProgramServiceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

@Api("小程序热门服务")
@RestController
@RequestMapping("/miniprogram/popular")
public class MiniProgramPopularServicesController extends BaseController {
    @Resource
    IMiniProgramServiceService miniProgramServiceService;

    /**
     * 根据服务次数查询出热门服务
     * @return
     */
    @ApiOperation("获取热门服务")
    @RequestMapping("/get")
    public AjaxResult getPopular(){
        List<MiniProgramServiceVO> list = miniProgramServiceService.getPopular();
        return success(list);
    }
}
